// 定义一个函数类型，参数为word,返回值为字符串类型
interface SayHi {
  ( word: string ): string;
  ( search: string ): string;
}

const say: SayHi = ( word: string ) => word
const search: SayHi = ( search: string ) => search

// e: '123'; 相当于: type free = "123"; (e: free, val: string): void
/*
  interface Test {
    (e: '123', val: string): void;
  }
  说明:
    1. e: '123'; ts会把'123'当作是一个类型, 赋值时直接赋值'123'就可以了
    2. e: number; 那么赋值时给任意数值型就可以，因为是js定义的
    3. 
*/
interface Test {
  (e: '123', val: string): void
}

// 红线提示为在其他文件也使用了这个变量名
type frees = "tabClick" | "";
interface Emits {
	(e: free, val: string): void;
}

const emits: Emits = (e: frees, val: string) => { return val; }
emits('tabClick', '123');

const yourSelfx: Test = (e: '123', val: string) => { return undefined; }
yourSelfx('123', '123');